<?php
include('include/config.inc.php');
$categoryId                        = isset($_GET['categoryId']) ? $_GET['categoryId'] : 0; //Variables for selection of Sub-Catogory
$subCategoryArr['subCategoryId']   = array();                                              //Variables for selection of Sub-Catogory
$subCategoryArr['subCategoryName'] = array();                                              //Variables for selection of Sub-Catogory

// To get value of Sub-Category Names : Starts
$subCategoryQuery = "SELECT subCategoryId,subCategoryName
                       FROM subcategory
                      WHERE categoryId = ".$_GET['categoryId']."
                   ORDER BY subCategoryName";
$subCategoryQueryRes = mysql_query($subCategoryQuery);
$i = 0;
while($subCategoryRow = mysql_fetch_array($subCategoryQueryRes))
{
  $subCategoryArr['subCategoryId'][$i]   = $subCategoryRow['subCategoryId'];
  $subCategoryArr['subCategoryName'][$i] = $subCategoryRow['subCategoryName'];
  $i++;
}
// To get value of Sub-Category Names : Ends
include("./bottom.php");
$smarty->assign("categoryId",$categoryId);
$smarty->assign("subCategoryArr",$subCategoryArr);
$smarty->display("subCategoryAj.tpl");
?>